//
//  BuddyCell.m
//  SeaChat
//
//  Created by 刘汉 on 16/6/17.
//  Copyright © 2016年 潘强. All rights reserved.
//

#import "BuddyCell.h"

@interface BuddyCell ()


@end

@implementation BuddyCell
//- (void)dealloc
//{
//    [_headV release];
//    [_NameLabel release];
//    [super dealloc];
//}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatSubView];
    }
    return self;

}
-(void)creatSubView{
    self.headV = [UIImageView new];
    [self addSubview:self.headV];
   // self.headV.backgroundColor = [UIColor greenColor];
    self.headV.contentMode = UIViewContentModeScaleAspectFit;
   

    self.NameLabel = [UILabel new];
    [self addSubview:self.NameLabel];
    self.NameLabel.backgroundColor = [UIColor clearColor];
}
-(void)layoutSubviews{
    [super layoutSubviews];

    [self.headV makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(+10);
        make.bottom.equalTo(-10);
        make.right.equalTo(-WIDTH/7 * 6);
    }];


//    self.headV.frame = CGRectMake(0, 0, 100, 100);

    
    [self.NameLabel makeConstraints:^(MASConstraintMaker *make) {
    make.top.equalTo(10);
    make.left.equalTo(self.headV.right).offset(3);
    make.bottom.equalTo(self.headV.bottom);
    make.right.equalTo(-10);
    }];

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
